#include <iostream>
#include <iomanip>
#include <string>
#include <clocale>
#include <chrono>
#include "Watch.h"

using namespace std;
using namespace Course;
//using namespace Course::adt;

#pragma optimize("",off)

void triangle_iterative(int n)
{
	if(n == 0)
		return;
	for(int i=0; i<=n; i++)
	{
		for(int j=0; j<i; j++)
		{
			cout << "*";
		}
		cout << endl;
	}
	for(int i=n; i>=0; i--)
	{
		for(int j=0; j<i; j++)
		{
			cout << "*";
		}
		cout << endl;
	}
}

void triangle_recursive(ostream& outs, unsigned int m, unsigned int n)
{
	if(m>n)
		return;
	
	if(m <= n)
	{
			for(int i=0; i<m; i++)
			{
				outs << "*";	
			}
			outs << endl;	

			triangle_recursive(outs, m+1, n);

			for(int j=0; j<m; j++)
			{
				outs << "*";
			}
			outs << endl;
	}			
}


int main()
{
	setlocale (LC_ALL, "swedish");

	//triangle_iterative(10);

	triangle_recursive(cout, 3, 10);


	cout << endl;
	system("PAUSE");
	return 0;
}

//#pragma optimize("",on)